using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Runtime.Serialization;

namespace WSBanking.DTO
{
	/// <summary>
	/// Data transfer object which is associated with SEBanking_Account table in database
	/// </summary>
	[DataContract]
	public class SEBanking_AccountDTO
	{
		[DataMember]
		public string Acc_ID { get; set; }
		[DataMember]
		public string Acc_Password { get; set; }
		[DataMember]
		public string Acc_Name { get; set; }
		[DataMember]
		public string Acc_Mail { get; set; }
		[DataMember]
		public int AccType_ID { get; set; }

		public static SEBanking_AccountDTO Translate(DataRow row)
		{
			var dto = new SEBanking_AccountDTO
			{
				Acc_ID = row["Acc_ID"].ToString(),
				Acc_Password = row["Acc_Password"].ToString(),
				Acc_Name = row["Acc_Name"].ToString(),
				Acc_Mail = row["Acc_Mail"].ToString(),
				AccType_ID = int.Parse(row["AccType_ID"].ToString()),
			};
			return dto;
		}
	}
}